package com.gm.wj.dao;

import com.gm.wj.entity.PtMember;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface PtMemberDAO extends JpaRepository<PtMember,Integer> {

    List<PtMember> findByFatherId(String fatherId);

    // 设置拼团团单状态
    @Transactional
    @Query(value = "update pt_member set pt_status=?2 where id=?1 ", nativeQuery = true)
    @Modifying
    void updateStatus(int id, int i);

    PtMember findByChildrenId(String key);

    PtMember findByOrderId(String out_trade_no);

}
